package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface DishFlavorMapper {


    /*删除菜品的口味对应的信息*/
    @Delete("delete from  dish_flavor where dish_id = #{id}")
    void delectByDishId(Long id);

    /*
        批量插入口味
         */
    void insertBatch(List<DishFlavor> flavors);

    /*根据菜品id集合关联的口味数据*/
    void delectByDishIds(List<Long> ids);

    /*根据菜品对象查询对应的口味信息*/
    @Select("select * from dish_flavor where dish_id=#{id}")
    List<DishFlavor> getByDishId(Long id);
}
